var smell=document.querySelector(".smell");
var move=document.querySelector(".move");
var big=document.querySelector(".big");
var bigImg=document.querySelector(".bigImg");
smell.onmouseenter=function(){
    move.style.display="block";
    big.style.display="block";
}
smell.onmouseleave=function(){
    move.style.display="none";
    big.style.display="none";
}
smell.onmousemove=function(e){
    var e=event||window.event;
    var maxLeft=smell.offsetWidth-move.offsetWidth;
    var maxTop=smell.offsetHeight-move.offsetHeight;
    var left=e.clientX-move.offsetWidth/2;
    var top=e.clientY-move.offsetHeight/2;
    left=left<=0?0:left;
    left=left>=maxLeft?maxLeft:left;
    top=top<=0?0:top;
    top=top>=maxTop?maxTop:top;
    move.style.left=left+"px";
    move.style.top=top+"px";
    bigImg.style.left=(-left/maxLeft)*(bigImg.offsetWidth-big.offsetWidth)+"px";
    bigImg.style.top=(-top/maxTop)*(bigImg.offsetHeight-big.offsetHeight)+"px";
}